package demo.consumer;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class ReceiveService {

    @Autowired
    private Sink sink;

    @Autowired
    private MySink mySink;

    @StreamListener(value = Sink.INPUT)
    public void receiveMessage(String message) {
        log.info(Sink.INPUT + "接收到的消息是：" + message);
    }

    @StreamListener("input1")
    public void receiveMessage1(String message) {
        log.info("接收到的消息是1：" + message);
    }

    @StreamListener("inputTX")
    public void receiveTransactionMessage(String message) {
        log.info("接收到的 事务 消息是：" + message);
    }
}